package cn.tedu.csmall.stock.webapi.mapper;
 /*
 @Time: 2022/11/28 13:10
 @Author:GShuai
 @File:StockMapper.class
 @Software:IntelliJ IDEA
*/

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface StockMapper {
    // 修改（减少指定商品库存数方法）
    @Update("update stock_tbl set count=count-#{reduceCount} where commodity_code=#{commodityCode} and count>=#{reduceCount}")
    void updateStockByCommodityCode(@Param("commodityCode") String commodityCode,@Param("reduceCount") Integer reduceCount );

}
